namespace ext.tree
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// Provides sorting of nodes in a {@link Ext.tree.TreePanel}. The TreeSorter automatically monitors events on the
	/// associated TreePanel that might affect the tree&apos;s sort order (beforechildrenrendered, append, insert and textchange).
	/// Example usage:  
	/// new Ext.tree.TreeSorter(myTree, {
	/// folderSort: true,
	/// dir: &quot;desc&quot;,
	/// sortType: function(node) {
	/// // sort by a custom, typed attribute:
	/// return parseInt(node.id, 10);
	/// }
	/// });
	/// </summary>
	/// <htmlSummary>
	/// Provides sorting of nodes in a {@link Ext.tree.TreePanel}. The TreeSorter automatically monitors events on the
	/// associated TreePanel that might affect the tree&apos;s sort order (beforechildrenrendered, append, insert and textchange).
	/// Example usage:&lt;br /&gt;
	/// &lt;pre&gt;&lt;code&gt;
	/// new Ext.tree.TreeSorter(myTree, {
	/// folderSort: true,
	/// dir: &quot;desc&quot;,
	/// sortType: function(node) {
	/// // sort by a custom, typed attribute:
	/// return parseInt(node.id, 10);
	/// }
	/// });
	/// &lt;/code&gt;&lt;/pre&gt;
	/// </htmlSummary>
	/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
	[ScriptName("TreeSorter")]
	[ScriptNamespace("Ext.tree")]
	[Imported()]
	public partial class TreeSorter
	{
		
		#region Constructors
		/// <summary>Constructor</summary>
		/// <param name="tree"></param>
		/// <param name="config"></param>
		public TreeSorter(ext.tree.TreePanel tree, ext.tree.TreeSorter_Configuration config)
		{
		}
		
		/// <summary>Constructor</summary>
		public TreeSorter()
		{
		}
		#endregion
		
		#region Fields
		/// <summary>True to sort leaf nodes under non-leaf nodes (defaults to false)</summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("folderSort")]
		public bool FolderSort;
		
		/// <summary>
		/// The named attribute on the node to sort by (defaults to &quot;text&quot;). Note that this
		/// property is only used if no {@link #sortType} function is specified, otherwise it is ignored.
		/// </summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("property")]
		public string Property;
		
		/// <summary>The direction to sort (&quot;asc&quot; or &quot;desc,&quot; case-insensitive, defaults to &quot;asc&quot;)</summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("dir")]
		public string Dir;
		
		/// <summary>The attribute used to determine leaf nodes when {@link #folderSort} = true (defaults to &quot;leaf&quot;)</summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("leafAttr")]
		public string LeafAttr;
		
		/// <summary>true for case-sensitive sort (defaults to false)</summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("caseSensitive")]
		public bool CaseSensitive;
		
		/// <summary>
		/// A custom &quot;casting&quot; function used to convert node values before sorting. The function
		/// will be called with a single parameter (the {@link Ext.tree.TreeNode} being evaluated) and is expected to return
		/// the node&apos;s sort value cast to the specific data type required for sorting. This could be used, for example, when
		/// a node&apos;s text (or other attribute) should be sorted as a date or numeric value. See the class description for
		/// example usage. Note that if a sortType is specified, any {@link #property} config will be ignored.
		/// </summary>
		/// <definedin>src\widgets\tree\TreeSorter.js</definedin>
		[ScriptName("sortType")]
		public System.Delegate SortType;
		#endregion
	}
}
